package com.yuyou.fn.tms.tool;

import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.IOException;
import java.util.Date;
import java.util.List;

public class Tools {

    private static String type(String src){
        switch (src){
            case "Int" :{
                src = "Long" ;
                break;
            }case "datetime" :{
                src = "Date" ;
                break;
            }case "number" :{
                src = "BigDecimal" ;
                break;
            }
        }
        return src ;
    }

    public static void main(String[] args) throws IOException {
        System.out.println(new Date().getTime());
        List<String> lines = FileUtils.readLines(new File("F:\\workProject\\yyfn-tms\\src\\test\\java\\com\\yuyou\\fn\\tms\\tool\\src.txt"), "utf-8");

        for(int i = 0 ; i < lines.size() ; i += 3){
            System.out.println(String.format("@ApiModelProperty(\""+lines.get(i + 2 )+"\")\n"+"private %s %s ;//%s\n" , type( lines.get(i + 1 ) ) , lines.get(i ) , lines.get(i + 2 ) ));
        }


        for(int i = 0 ; i < lines.size() ; i += 3){
            String w = lines.get(i);
            System.out.println(String.format("this.set%s();//%s " , w.substring(0,1).toUpperCase()+w.substring(1), lines.get(i + 2 )));
        }

    }

}
